/**
 * Java Enterprise in a Nutshell, Third Edition, 
 * by Jim Farley and William Crawford 
 * with Prakash Malani, John G. Norman, and Justin Gehtland. 
 * Copyright 2006 O'Reilly Media, Inc., 0-596-10142-2.
 *  
 * Modified by Vladimir Tarasov, 2008-06-17.
 * Tested with JDK 1.6.
 * The folder containing the class file should be on the CLASSPATH.
 */

package tavl_rmi.account;

import java.rmi.Remote;
import java.rmi.RemoteException;

/**
 * Account: A simple RMI interface that represents a banking account.
 * This interface is used in both simple and factory RMI examples.
 * 
 * Any RMI interface must (directly ot indirectly) extend Remote.
 * Any RMI method must throw RemoteException or a subclass of it.
 */
public interface Account extends Remote {
  // Get the name on the account
  public String getName() throws RemoteException;
  // Get current balance
  public float getBalance() throws RemoteException;
  // Take some money away
  public void withdraw(float amt)
  throws RemoteException, InsufficientFundsException;
  // Put some money in
  public void deposit(float amt) throws RemoteException;
  // Move some money from one account into this one.
  // A remote method argument (and return value) must be either serializable or 
  // remote. Remote arguments are sent by reference, serializable - by copy.
  // Serializable means a primitive Java data type or an object implementing
  // java.io.Serializable.
  public void transfer(float amt, Account src)
    throws RemoteException, InsufficientFundsException;
}
